<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/gbdk/emu_debug.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.4.0</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('gbdk_2emu__debug_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">emu_debug.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;types.h&gt;</code><br />
</div>
<p><a href="gbdk_2emu__debug_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a5624be3849bf5308c6cc05bc4a624557"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE</a>(message_text)&#160;&#160;&#160;EMU_MESSAGE1(EMU_MACRONAME(__LINE__), message_text)</td></tr>
<tr class="separator:a5624be3849bf5308c6cc05bc4a624557"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aabd48c83af8f69ed624bb8a83347fa39"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#aabd48c83af8f69ed624bb8a83347fa39">BGB_MESSAGE</a>(message_text)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE</a>(message_text)</td></tr>
<tr class="separator:aabd48c83af8f69ed624bb8a83347fa39"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5359c3e6ddab89f41f1de770cc3640d4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#a5359c3e6ddab89f41f1de770cc3640d4">EMU_PROFILE_BEGIN</a>(MSG)&#160;&#160;&#160;EMU_MESSAGE_SUFFIX(MSG, &quot;%ZEROCLKS%&quot;);</td></tr>
<tr class="separator:a5359c3e6ddab89f41f1de770cc3640d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5b05deda52856c84f274fb28578b6ee"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#ab5b05deda52856c84f274fb28578b6ee">BGB_PROFILE_BEGIN</a>(MSG)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#a5359c3e6ddab89f41f1de770cc3640d4">EMU_PROFILE_BEGIN</a>(MSG)</td></tr>
<tr class="separator:ab5b05deda52856c84f274fb28578b6ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acce78126775a7ca3c862459e28203aba"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#acce78126775a7ca3c862459e28203aba">EMU_PROFILE_END</a>(MSG)&#160;&#160;&#160;EMU_MESSAGE_SUFFIX(MSG,&quot;%-8+LASTCLKS%&quot;);</td></tr>
<tr class="separator:acce78126775a7ca3c862459e28203aba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab43f94064dc523e99c4aefb440e2c3ed"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#ab43f94064dc523e99c4aefb440e2c3ed">BGB_PROFILE_END</a>(MSG)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#acce78126775a7ca3c862459e28203aba">EMU_PROFILE_END</a>(MSG)</td></tr>
<tr class="separator:ab43f94064dc523e99c4aefb440e2c3ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1ca656789d7d285b352afeaa4cc56bd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#ad1ca656789d7d285b352afeaa4cc56bd">EMU_TEXT</a>(MSG)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE</a>(MSG)</td></tr>
<tr class="separator:ad1ca656789d7d285b352afeaa4cc56bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6afa665bd7d093e7ca2d310cc92b08a9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#a6afa665bd7d093e7ca2d310cc92b08a9">BGB_TEXT</a>(MSG)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#ad1ca656789d7d285b352afeaa4cc56bd">EMU_TEXT</a>(MSG)</td></tr>
<tr class="separator:a6afa665bd7d093e7ca2d310cc92b08a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af36a13974260d50a3b602f5106f4b9e1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#af36a13974260d50a3b602f5106f4b9e1">BGB_profiler_message</a>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#aa5de1bb0c5fd4fbb23019b4908cc9588">EMU_profiler_message</a>()</td></tr>
<tr class="separator:af36a13974260d50a3b602f5106f4b9e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a892ddea0cd396141c1ae05e384303cbf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#a892ddea0cd396141c1ae05e384303cbf">BGB_printf</a>(...)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#a910b2802e154473f2e10201f5722bc10">EMU_printf</a>(__VA_ARGS__)</td></tr>
<tr class="separator:a892ddea0cd396141c1ae05e384303cbf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e856b4691d63bb41c5148b9097bd2bb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#a9e856b4691d63bb41c5148b9097bd2bb">EMU_BREAKPOINT</a>&#160;&#160;&#160;__asm__(&quot;ld <a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>, <a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>&quot;);</td></tr>
<tr class="separator:a9e856b4691d63bb41c5148b9097bd2bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95c9ae3faadfe6f93a3cac87085b3481"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#a95c9ae3faadfe6f93a3cac87085b3481">BGB_BREAKPOINT</a>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#a9e856b4691d63bb41c5148b9097bd2bb">EMU_BREAKPOINT</a></td></tr>
<tr class="separator:a95c9ae3faadfe6f93a3cac87085b3481"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aa5de1bb0c5fd4fbb23019b4908cc9588"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#aa5de1bb0c5fd4fbb23019b4908cc9588">EMU_profiler_message</a> (void)</td></tr>
<tr class="separator:aa5de1bb0c5fd4fbb23019b4908cc9588"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a910b2802e154473f2e10201f5722bc10"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#a910b2802e154473f2e10201f5722bc10">EMU_printf</a> (const char *format,...) <a class="el" href="asm_2types_8h.html#acb825e83a33fcc06482c59b4ab2cf961">PRESERVES_REGS</a>(a</td></tr>
<tr class="separator:a910b2802e154473f2e10201f5722bc10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a322fb0f357e31e5f275d6c1b2c71d1e7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#a322fb0f357e31e5f275d6c1b2c71d1e7">EMU_fmtbuf</a> (const unsigned char *format, void *data) <a class="el" href="asm_2types_8h.html#acb825e83a33fcc06482c59b4ab2cf961">PRESERVES_REGS</a>(a</td></tr>
<tr class="separator:a322fb0f357e31e5f275d6c1b2c71d1e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a4c2e4adef74067fdbb49005bc73de937"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a></td></tr>
<tr class="separator:a4c2e4adef74067fdbb49005bc73de937"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b3366755f3276b0243c1e0497471b7a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#a0b3366755f3276b0243c1e0497471b7a">c</a></td></tr>
<tr class="separator:a0b3366755f3276b0243c1e0497471b7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Debug window logging and profiling support for emulators (BGB, Emulicious, etc).</p>
<p>Also see the <code>emu_debug</code> example project included with gbdk.</p>
<p>See the BGB Manual for more information ("expressions, breakpoint conditions, and debug messages") <a href="http://bgb.bircd.org/manual.html#expressions">http://bgb.bircd.org/manual.html#expressions</a> </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a5624be3849bf5308c6cc05bc4a624557"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5624be3849bf5308c6cc05bc4a624557">&#9670;&nbsp;</a></span>EMU_MESSAGE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define EMU_MESSAGE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">message_text</td><td>)</td>
          <td>&#160;&#160;&#160;EMU_MESSAGE1(EMU_MACRONAME(__LINE__), message_text)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Macro to display a message in the emulator debug message window</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">message_text</td><td>Quoted text string to display in the debug message window</td></tr>
  </table>
  </dd>
</dl>
<p>The following special parameters can be used when bracketed with "%" characters. </p><ul>
<li>CPU registers: AF, BC, DE, HL, SP, PC, B, C, D, E, H, L, A, ZERO, ZF, Z, CARRY, CY, IME, ALLREGS </li>
<li>Other state values: ROMBANK, XRAMBANK, SRAMBANK, WRAMBANK, VRAMBANK, TOTALCLKS, LASTCLKS, CLKS2VBLANK</li>
</ul>
<p>Example: print a message along with the currently active ROM bank. </p><div class="fragment"><div class="line"><a class="code" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE</a>(<span class="stringliteral">&quot;Current ROM Bank is: %ROMBANK%&quot;</span>);</div>
<div class="ttc" id="agbdk_2emu__debug_8h_html_a5624be3849bf5308c6cc05bc4a624557"><div class="ttname"><a href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE</a></div><div class="ttdeci">#define EMU_MESSAGE(message_text)</div><div class="ttdef"><b>Definition:</b> emu_debug.h:46</div></div>
</div><!-- fragment --><p>See the BGB Manual for more information ("expressions, breakpoint conditions, and debug messages") <a href="http://bgb.bircd.org/manual.html#expressions">http://bgb.bircd.org/manual.html#expressions</a></p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="gbdk_2emu__debug_8h.html#a5359c3e6ddab89f41f1de770cc3640d4">EMU_PROFILE_BEGIN()</a>, <a class="el" href="gbdk_2emu__debug_8h.html#acce78126775a7ca3c862459e28203aba">EMU_PROFILE_END()</a> </dd></dl>

</div>
</div>
<a id="aabd48c83af8f69ed624bb8a83347fa39"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aabd48c83af8f69ed624bb8a83347fa39">&#9670;&nbsp;</a></span>BGB_MESSAGE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BGB_MESSAGE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">message_text</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE</a>(message_text)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a5359c3e6ddab89f41f1de770cc3640d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5359c3e6ddab89f41f1de770cc3640d4">&#9670;&nbsp;</a></span>EMU_PROFILE_BEGIN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define EMU_PROFILE_BEGIN</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">MSG</td><td>)</td>
          <td>&#160;&#160;&#160;EMU_MESSAGE_SUFFIX(MSG, &quot;%ZEROCLKS%&quot;);</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Macro to <b>Start</b> a profiling block for the emulator (BGB, Emulicious, etc)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MSG</td><td>Quoted text string to display in the debug message window along with the result</td></tr>
  </table>
  </dd>
</dl>
<p>To complete the profiling block and print the result call <a class="el" href="gbdk_2emu__debug_8h.html#acce78126775a7ca3c862459e28203aba">EMU_PROFILE_END</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="gbdk_2emu__debug_8h.html#acce78126775a7ca3c862459e28203aba">EMU_PROFILE_END()</a>, <a class="el" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE()</a> </dd></dl>

</div>
</div>
<a id="ab5b05deda52856c84f274fb28578b6ee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5b05deda52856c84f274fb28578b6ee">&#9670;&nbsp;</a></span>BGB_PROFILE_BEGIN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BGB_PROFILE_BEGIN</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">MSG</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#a5359c3e6ddab89f41f1de770cc3640d4">EMU_PROFILE_BEGIN</a>(MSG)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="acce78126775a7ca3c862459e28203aba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acce78126775a7ca3c862459e28203aba">&#9670;&nbsp;</a></span>EMU_PROFILE_END</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define EMU_PROFILE_END</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">MSG</td><td>)</td>
          <td>&#160;&#160;&#160;EMU_MESSAGE_SUFFIX(MSG,&quot;%-8+LASTCLKS%&quot;);</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Macro to <b>End</b> a profiling block and print the results in the emulator debug message window</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MSG</td><td>Quoted text string to display in the debug message window along with the result</td></tr>
  </table>
  </dd>
</dl>
<p>This should only be called after a previous call to <a class="el" href="gbdk_2emu__debug_8h.html#a5359c3e6ddab89f41f1de770cc3640d4">EMU_PROFILE_BEGIN()</a></p>
<p>The results are in Emulator clock units, which are "1 nop in [CGB] doublespeed mode".</p>
<p>So when running in Normal Speed mode (i.e. non-CGB doublespeed) the printed result should be <b>divided by 2</b> to get the actual ellapsed cycle count.</p>
<p>If running in CB Double Speed mode use the below call instead, it correctly compensates for the speed difference. In this scenario, the result does <b>not need to be divided by 2</b> to get the ellapsed cycle count. </p><div class="fragment"><div class="line"><a class="code" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE</a>(<span class="stringliteral">&quot;NOP TIME: %-4+LASTCLKS%&quot;</span>);</div>
</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="gbdk_2emu__debug_8h.html#a5359c3e6ddab89f41f1de770cc3640d4">EMU_PROFILE_BEGIN()</a>, <a class="el" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE()</a> </dd></dl>

</div>
</div>
<a id="ab43f94064dc523e99c4aefb440e2c3ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab43f94064dc523e99c4aefb440e2c3ed">&#9670;&nbsp;</a></span>BGB_PROFILE_END</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BGB_PROFILE_END</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">MSG</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#acce78126775a7ca3c862459e28203aba">EMU_PROFILE_END</a>(MSG)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad1ca656789d7d285b352afeaa4cc56bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad1ca656789d7d285b352afeaa4cc56bd">&#9670;&nbsp;</a></span>EMU_TEXT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define EMU_TEXT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">MSG</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE</a>(MSG)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a6afa665bd7d093e7ca2d310cc92b08a9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6afa665bd7d093e7ca2d310cc92b08a9">&#9670;&nbsp;</a></span>BGB_TEXT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BGB_TEXT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">MSG</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#ad1ca656789d7d285b352afeaa4cc56bd">EMU_TEXT</a>(MSG)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="af36a13974260d50a3b602f5106f4b9e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af36a13974260d50a3b602f5106f4b9e1">&#9670;&nbsp;</a></span>BGB_profiler_message</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BGB_profiler_message&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#aa5de1bb0c5fd4fbb23019b4908cc9588">EMU_profiler_message</a>()</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a892ddea0cd396141c1ae05e384303cbf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a892ddea0cd396141c1ae05e384303cbf">&#9670;&nbsp;</a></span>BGB_printf</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BGB_printf</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em></td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#a910b2802e154473f2e10201f5722bc10">EMU_printf</a>(__VA_ARGS__)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a9e856b4691d63bb41c5148b9097bd2bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e856b4691d63bb41c5148b9097bd2bb">&#9670;&nbsp;</a></span>EMU_BREAKPOINT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define EMU_BREAKPOINT&#160;&#160;&#160;__asm__(&quot;ld <a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>, <a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>&quot;);</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The Emulator will break into debugger when encounters this line </p>

</div>
</div>
<a id="a95c9ae3faadfe6f93a3cac87085b3481"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a95c9ae3faadfe6f93a3cac87085b3481">&#9670;&nbsp;</a></span>BGB_BREAKPOINT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BGB_BREAKPOINT&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#a9e856b4691d63bb41c5148b9097bd2bb">EMU_BREAKPOINT</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="aa5de1bb0c5fd4fbb23019b4908cc9588"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5de1bb0c5fd4fbb23019b4908cc9588">&#9670;&nbsp;</a></span>EMU_profiler_message()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EMU_profiler_message </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Display preset debug information in the Emulator debug messages window.</p>
<p>This function is equivalent to: </p><div class="fragment"><div class="line"><a class="code" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">EMU_MESSAGE</a>(<span class="stringliteral">&quot;PROFILE,%(SP+$0)%,%(SP+$1)%,%A%,%TOTALCLKS%,%ROMBANK%,%WRAMBANK%&quot;</span>);</div>
</div><!-- fragment --> 
</div>
</div>
<a id="a910b2802e154473f2e10201f5722bc10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a910b2802e154473f2e10201f5722bc10">&#9670;&nbsp;</a></span>EMU_printf()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EMU_printf </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Print the string and arguments given by format to the emulator debug message window</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">format</td><td>The format string as per printf</td></tr>
  </table>
  </dd>
</dl>
<p>Does not return the number of characters printed. Currently supported: </p><ul>
<li>%hx (char as hex) </li>
<li>%hu (unsigned char) </li>
<li>%hd (signed char) </li>
<li>%c (character) <br  />
 </li>
<li>%u (unsigned int) </li>
<li>%d (signed int) </li>
<li>%x (unsigned int as hex) </li>
<li>%s (string)</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>Variables for the following 8-bit formats <b>MUST</b> be cast to their type when passed to <a class="el" href="gbdk_2emu__debug_8h.html#a910b2802e154473f2e10201f5722bc10">EMU_printf()</a> <ul>
<li>%hx (char) </li>
<li>%hu (unsigned char) </li>
<li>%hd (signed char)</li>
</ul>
However variables for the following 8-bit format <b>MUST NOT</b> be cast to their type when passed to <a class="el" href="gbdk_2emu__debug_8h.html#a910b2802e154473f2e10201f5722bc10">EMU_printf()</a> <ul>
<li>%c (char)</li>
</ul>
This behavior is <b>different</b> than for <a class="el" href="stdio_8h.html#a440c82287022737c4f2866786ba8a154">sprintf()</a>, which does require %c format char variables to be explicitly cast.</dd></dl>
<p>Currently supported in the Emulicious emulator, may be supported by bgb </p>

</div>
</div>
<a id="a322fb0f357e31e5f275d6c1b2c71d1e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a322fb0f357e31e5f275d6c1b2c71d1e7">&#9670;&nbsp;</a></span>EMU_fmtbuf()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EMU_fmtbuf </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Print the string and arguments in the buffer buffer by the pointer given by format to the emulator debug message window</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">format</td><td>The format string as per printf </td></tr>
    <tr><td class="paramname">data</td><td>Buffer containing arguments, for example some struct</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="gbdk_2emu__debug_8h.html#a910b2802e154473f2e10201f5722bc10">EMU_printf</a> for the format string description</dd></dl>
<p>Currently supported in the Emulicious emulator </p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a4c2e4adef74067fdbb49005bc73de937"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c2e4adef74067fdbb49005bc73de937">&#9670;&nbsp;</a></span>b</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a0b3366755f3276b0243c1e0497471b7a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b3366755f3276b0243c1e0497471b7a">&#9670;&nbsp;</a></span>c</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void c</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>
